<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/



Route::get('/menu', 'FileController@menu');
Route::get('file/{filename}', 'FileController@index')->name('file')->where(['filename' => '.*']);
Route::get('is_choujiang', 'UserController@choujiang');
Route::get('/','Admin\LoginController@showLoginForm');
Route::get('/map','IndexController@map');



Route::post('/upload', 'Admin\\ImageController@upload')->name('image_upload');
//兑换码页面
Route::get('/exchange','ExchangeController@index')->middleware('Wechat');
Route::post('/exchange','ExchangeController@post')->name('exchange');

Route::get('/ibeacon', 'IbeaconController@index')->middleware('Wechat');
Route::any('/payment', 'PaymentController@payment');
Route::post('/payfor', 'PaymentController@payfor');

Auth::routes();
Route::post('/upload', 'Admin\\ImageController@upload')->name('image_upload
');


Route::get('/ibeacon', 'IbeaconController@index')->middleware('Wechat');
Route::any('/payment', 'PaymentController@payment');
Route::post('/payfor', 'PaymentController@payfor');

Route::group(['prefix' => 'listener'], function () {
    $namespace = 'ListenerController@';
//    Route::get('/',$namespace.'index')->name('listener');
    Route::get('/audition', $namespace . 'audition')->name('listener.audition');
    Route::get('/{id}', $namespace . 'index')->name('listener');
});

Route::any('/order', 'PaymentController@order');
Route::any('/jspayfor', 'PaymentController@jspayfor')->name('jspayfor');
//游戏页面

Route::group(['prefix' => 'game', 'middleware' => 'Wechat'], function () {
    Route::get('/tiger', 'GameController@index');
    Route::post('/run', 'GameController@run');
    Route::get('/tetris', 'GameController@tetris')->name('tetris');

});


Route::get('/test/{game}', 'IndexController@game');

//详情页面

Route::group(['prefix' => 'scenic'], function () {//

    Route::get('/list', 'ScenicController@list')->name('scene_list');//
    Route::get('/', 'ScenicController@index')->name('scene_index');//
    Route::get('/shake', 'ScenicController@shake')->name('shake');//
    Route::get('/shakeTest', 'ScenicController@shaketest')->name('shaketest');//试听景点
    Route::post('/ajaxScenic', 'ScenicController@ajaxScenic')->name('ajaxScenic');//

    Route::get('/{id}', 'ScenicController@detail')->name('scene')->middleware('Wechat');
});
//活动
Route::group(['prefix' => 'activity'], function () {
    //活动列表
    Route::get('/', 'ActivityController@index')->name('activity');
    //活动详情
    Route::get('/{id}', 'ActivityController@detail');
    Route::post('/ajaxActivity', 'ActivityController@ajaxList')/*->middleware('Wechat')*/
    ;
});
//用户首页

Route::group(['prefix' => 'user'], function () {//用户中心
    //个人得奖二维码
    Route::get('/prizeCode', 'UserController@prizeCode')->name('user_prizeCode')->middleware('Wechat');
    Route::get('/memberPrize', 'UserController@memberPrize')->name('memberPrize')->middleware('Wechat');
    Route::get('/', 'UserController@index')->name('user')->middleware('Wechat');//套餐列表
    Route::get('/qrcode', 'UserController@qrcode')->name('user_qrcoderout')->middleware('Wechat');
    Route::get('/{user_id}/qrcode', 'UserController@userQrcode')->name('user_qrcode');
    Route::get('/combo', 'UserController@combo')->name('user_combo')->middleware('Wechat');
    Route::get('/group', 'UserController@group')->name('user_group')->middleware('Wechat');
    //套餐退款
    Route::post('/comboRefund', 'UserController@comboRefund')->name('user_combo_Refund')->middleware('Wechat');
    Route::get('/profile', 'UserController@profile')->name('user_profile')->middleware('Wechat');
    Route::post('/profile', 'UserController@profile')->name('user_profile')->middleware('Wechat');
    //AJAX 获取推广者数据
    Route::post('/ajaxGroup', 'UserController@ajaxGroup')/*->middleware('Wechat')*/
    ;
    Route::get('/ticketQrcode','UserController@ticketQrcode')->name('ticketQrcode');
    //用户奖品列表
    Route::get('/user_prizes', 'UserController@user_prizes')->name('user_prizes')->middleware('Wechat');
    //中奖信息
    Route::get('/member_prize', 'UserController@member_prize')->name('member_prize')->middleware('Wechat');
    //提成纪录
    Route::get('/record', 'UserController@record')->name('user_record')->middleware('Wechat');
    Route::post('/ajaxRecord', 'UserController@ajaxRecord')->name('ajax_record')->middleware('Wechat');
    //提现
    Route::get('/withdrawals', 'UserController@withdrawals')->name('user_withdrawals')->middleware('Wechat');
    Route::post('/withstore', 'UserController@withdrawalsStore')->name('user_withdrawals_store')->middleware('Wechat');
    Route::get('/presentRecord', 'UserController@presentRecord')->name('user_presentRecord')->middleware('Wechat');
    Route::post('/ajaxPresentRecord', 'UserController@ajaxPresentRecord')->name('user_ajax_present_record')->middleware('Wechat');
    //阅换的套餐
    Route::get('/exchangeCombo','UserController@exchange')->name('user.exchange');
    //Route::get();
    //提现详情
    Route::get('/withdrawalsDetail/{id}', 'UserController@withdrawalsDetail')->name('user_withdrawalsDetail')->middleware('Wechat');
});
Route::group(['prefix' => 'combo'], function () {//景点套餐
    Route::get('/list', 'ComboController@index')->name('combo_list')->middleware('Wechat');//套餐列表
    Route::get('/{id}', 'ComboController@detail')->name('combo_detail')->middleware('Wechat');
});
//微信接入验证
Route::any('/weChat', 'WeChatController@serve');
Route::any('/wewechat123456', 'WeChatController@createMenu');
Route::group(['prefix' => 'wap'], function () {
    $namespace = 'Wap\\';
    Route::get('/', $namespace . 'IndexController@index');
    //栏目下的新闻
    Route::get('/page/{slug}', $namespace . 'PostController@index')->name('wap.post-list');
    Route::get('/ajax-list', $namespace . 'PostController@ajaxList')->name('wap.post-list-ajax');
    Route::get('/{id}/page', $namespace . 'PostController@detail')->name('wap.post-index');
    Route::get('/about', $namespace.'IndexController@about')->name('wap.about');
});
//更换语言
Route::get('/change_language/{language}', 'IndexController@change');
Route::group(['prefix' => 'admin', 'middleware' => 'admin.auth'], function () {
    $namespace = 'Admin\\';
    $prefix = 'admin';
    //admin首页
    Route::get('/', $namespace . 'IndexController@index');
    Route::get('/main', $namespace . 'IndexController@main');


    //得到文件
    Route::get('/file/{filename}', $namespace . 'FileController@index')->name('admin.file')->where(['filename' => '.*']);
    //退出登陆
    Route::get('/logout', $namespace . 'IndexController@logout')->name('admin.logout');
    //得到菜单
    Route::get('/menu', $namespace . 'IndexController@menu')->name('admin.menu');
    //菜单管理
    Route::group(['prefix' => '/dev-menu'], function () use ($namespace) {
        $namespace .= 'Menu\\';
        Route::get('/', $namespace . 'IndexController@index')->name('admin.dev-menu')->middleware('permission:admin');
        Route::get('/add', $namespace . 'IndexController@add')->name('admin.dev-menu-add')->middleware('permission:admin');
        Route::post('/add', $namespace . 'IndexController@saveOrInsert')->middleware('permission:admin');
        Route::get('/edit/{id}', $namespace . 'IndexController@edit')->name('admin.dev-menu-edit')->middleware('permission:admin');
        Route::post('/edit/{id}', $namespace . 'IndexController@saveOrInsert')->middleware('permission:admin');
        Route::get('/ajax', $namespace . 'IndexController@indexAjax')->name('admin.dev-menuAjax')->middleware('permission:admin');

    });
    //权限管理
    Route::group(['prefix' => '/permission'], function () use ($namespace) {
        $namespace .= 'Permission\\';
        Route::get('/', $namespace . 'IndexController@index')->name('admin.permission')->middleware('permission:admin');
        Route::get('/add', $namespace . 'IndexController@add')->name('admin.permission-add')->middleware('permission:admin');
        Route::post('/add', $namespace . 'IndexController@saveOrInsert')->middleware('permission:admin');
        Route::get('/edit/{id}', $namespace . 'IndexController@edit')->name('admin.permission-edit')->middleware('permission:admin');
        Route::post('/edit/{id}', $namespace . 'IndexController@saveOrInsert')->middleware('permission:admin');
        Route::get('/ajax', $namespace . 'IndexController@indexAjax')->name('admin.permissionAjax')->middleware('permission:admin');
    });
    //图片文件模块
    Route::group(['prefix' => 'image'], function () use ($namespace) {
        Route::post('/upload', $namespace . 'ImageController@upload')->name('admin.image_upload');
        Route::post('/upload1', $namespace . 'ImageController@upload1')->name('admin.image_upload1');
    });
    Route::group(['prefix' => 'voice'], function () use ($namespace) {
        Route::post('/upload', $namespace . 'VoiceController@upload')->name('admin.voice_upload');
    });
    Route::group(['prefix' => 'setting'], function () use ($namespace) {
        Route::get('/', $namespace . 'SettingController@index')->name('admin.setting')->middleware('permission:setting');
        Route::post('/store', $namespace . 'SettingController@saveChange')->name('admin.setting-store')->middleware('permission:setting');
    });
    //user模块
    Route::group(['prefix' => 'user'], function () use ($namespace) {
        //

        //修改密码
        Route::get('/modify_password', $namespace . 'UserController@modify_password')->name('admin.modify_password')->middleware('permission:modify_password');
        //修改密码提交
        Route::post('/modify_password/post', $namespace . 'UserController@modify_password_post')->name('admin.password_post');
        //编辑用户信息
        Route::get('/{id}/edit', $namespace . 'UserController@edit')->name('admin.user_edit')->middleware('permission:user_edit');

        Route::post('/update', $namespace . 'UserController@update')->name('admin.user_update')->middleware('permission:user_edit');
        //查看用户信息
        Route::get('/{id}/detail', $namespace . 'UserController@detail')->name('admin.user_detail')->middleware('permission:user_detail');
        //增加
        Route::get('/add', $namespace . 'UserController@add')->name('admin.user_add')->middleware('permission:user_add');
        Route::post('/store', $namespace . 'UserController@store')->name('admin.user_store')->middleware('permission:user_add');
        //屏蔽会员发布的所有作品
        Route::get('/{id}/display', $namespace . 'UserController@display')->name('admin.user_display')->middleware('permission:user_display');
        //修改admin个人信息
        Route::get('/user_info', $namespace . 'UserController@user_info')->name('admin.user_info');
        //提交修改个人信息
        Route::post('/user_info_post', $namespace . 'UserController@user_info_post')->name('admin.user_info_post');
        //用户列表
        Route::get('/index', $namespace . 'UserController@index')->name('admin.user_index');
        //设置前台权限
        Route::get('/{id}/set', $namespace . 'UserController@user_set')->name('admin.user_set')->middleware('permission:user_set');
        //ajax获取用户数据
        Route::get('/ajax_user_list', $namespace . 'UserController@ajax_list')->name('admin.user.ajaxList');

    });

//    //角色管理
    Route::group(['prefix' => 'role'], function () use ($namespace) {
        //列表页
        Route::get('/index', $namespace . 'RoleController@index')->name('admin.role_index')->middleware('permission:role_index');
        //ajax获取
        Route::get('/ajax_list', $namespace . 'RoleController@ajax_list')->name('admin.role_ajaxList')->middleware('permission:role_index');;
        //增加
        Route::get('/add', $namespace . 'RoleController@create')->name('admin.role_add')->middleware('permission:role_add');
        Route::post('/store', $namespace . 'RoleController@store')->name('admin.role_store')->middleware('permission:role_add');
        //授予权限
        Route::get('/{id}/permission', $namespace . 'RoleController@permission')->name('admin.role_permission')->middleware('permission:role_permission');
        Route::post('/permission/store', $namespace . 'RoleController@permissionStore')->name('admin.role_permission_store')->middleware('permission:role_permission');
        //修改
        Route::get('/{id}/edit', $namespace . 'RoleController@edit')->name('admin.role_edit')->middleware('permission:role_edit');
        Route::post('/update', $namespace . 'RoleController@update')->name('admin.role_update')->middleware('permission:role_edit');
        //删除
        Route::get('/del', $namespace . 'RoleController@del')->name('admin.role_del')->middleware('permission:role_del');


    });
    Route::group(['prefix' => 'prize'], function () use ($namespace) {
        //列表页
        Route::get('/', $namespace . 'PrizeController@index')->name('admin.prize_index')->middleware('permission:game');
        //ajax获取
        Route::get('/ajax_list', $namespace . 'PrizeController@ajax_list')->name('admin.prize_ajaxList')->middleware('permission:game');;
        //增加
        Route::get('/add', $namespace . 'PrizeController@create')->name('admin.prize_add')->middleware('permission:game');
        Route::post('/store', $namespace . 'PrizeController@store')->name('admin.prize_store')->middleware('permission:game');
        //修改
        Route::get('/{id}/edit', $namespace . 'PrizeController@edit')->name('admin.prize_edit')->middleware('permission:game');
        Route::post('/update', $namespace . 'PrizeController@update')->name('admin.prize_update')->middleware('permission:game');
        //删除
        Route::get('/del', $namespace . 'PrizeController@del')->name('admin.prize_del')->middleware('permission:game');
        //

    });
    Route::group(['prefix' => 'memberPrize'], function () use ($namespace) {
        //列表页
        Route::get('/', $namespace . 'MemberPrizeController@index')->name('admin.MemberPrize_index')->middleware('permission:game');
        //ajax获取
        Route::get('/ajax_list', $namespace . 'MemberPrizeController@ajax_list')->name('admin.MemberPrize_ajaxList')->middleware('permission:game');;
    });
    Route::group(['prefix' => 'refundOrder'], function () use ($namespace) {
        //列表页
        Route::get('/', $namespace . 'RefundOrderController@index')->name('admin.refundOrder_index')->middleware('permission:combo');
        //导出
        Route::get('/report', $namespace . 'RefundOrderController@report')->name('refund.report')->middleware('permission:combo');

        //ajax获取
        Route::get('/ajax_list', $namespace . 'RefundOrderController@ajax_list')->name('admin.refundOrder_ajaxList')->middleware('permission:combo');;
    });
    Route::group(['prefix' => 'prizeSetting'], function () use ($namespace) {
        //列表页
        Route::get('/', $namespace . 'PrizeSettingController@index')->name('admin.prizeSetting_index')->middleware('permission:game');
        //ajax获取
        Route::get('/ajax_list', $namespace . 'PrizeSettingController@ajax_list')->name('admin.prizeSetting_ajaxList')->middleware('permission:game');;
        //增加
        Route::get('/add', $namespace . 'PrizeSettingController@create')->name('admin.prizeSetting_add')->middleware('permission:game');
        Route::post('/store', $namespace . 'PrizeSettingController@store')->name('admin.prizeSetting_store')->middleware('permission:game');
        //修改
        Route::get('/{id}/edit', $namespace . 'PrizeSettingController@edit')->name('admin.prizeSetting_edit')->middleware('permission:game');
        Route::post('/update', $namespace . 'PrizeSettingController@update')->name('admin.prizeSetting_update')->middleware('permission:game');
        //删除
        Route::get('/del', $namespace . 'PrizeSettingController@del')->name('admin.prizeSetting_del')->middleware('permission:game');
        //

    });
    Route::group(['prefix' => 'game'], function () use ($namespace) {
        //列表页
        Route::get('/', $namespace . 'GameController@index')->name('admin.game_index')->middleware('permission:game');
        //ajax获取
        Route::get('/ajax_list', $namespace . 'GameController@ajax_list')->name('admin.game_ajaxList')->middleware('permission:game');;
        //增加
        Route::get('/add', $namespace . 'GameController@create')->name('admin.game_add')->middleware('permission:game');
        Route::post('/store', $namespace . 'GameController@store')->name('admin.game_store')->middleware('permission:game');
        //修改
        Route::get('/{id}/edit', $namespace . 'GameController@edit')->name('admin.game_edit')->middleware('permission:game');
        Route::post('/update', $namespace . 'GameController@update')->name('admin.game_update')->middleware('permission:game');
        //删除
        Route::get('/del', $namespace . 'GameController@del')->name('admin.game_del')->middleware('permission:game');
        //
        Route::get('/record', $namespace . 'GameController@record')->name('admin.record_index')->middleware('permission:game');
        //ajax获取
        Route::get('/record/ajax_list', $namespace . 'GameController@record_ajax_list')->name('admin.record_ajaxList')->middleware('permission:game');

        Route::get('/guize', $namespace . 'GameController@guize')->name('admin.guize')->middleware('permission:game');
    });
    //文章
    Route::group(['prefix' => 'posts'], function () use ($namespace) {
        $namespace .= 'Posts\\';
        Route::get('', $namespace . 'PostController@index')->name('admin.posts')->middleware('permission:posts');
        Route::get('/add', $namespace . 'PostController@add')->name('admin.posts-add')->middleware('permission:posts');
        Route::post('/add', $namespace . 'PostController@saveOrInsert')->middleware('permission:posts');
        Route::get('/edit/{id}', $namespace . 'PostController@edit')->name('admin.posts-edit')->middleware('permission:posts');
        Route::post('/edit/{id}', $namespace . 'PostController@saveOrInsert')->middleware('permission:posts');
        Route::get('/ajax', $namespace . 'PostController@indexAjax')->name('admin.postsAjax')->middleware('permission:posts');
    });
    //广告位
    Route::group(['prefix' => 'adseat'], function () use ($namespace) {
        $namespace .= 'Adseat\\';
        Route::get('', $namespace . 'AdseatController@index')->name('admin.adseat')->middleware('permission:adseat');
        Route::get('/add', $namespace . 'AdseatController@add')->name('admin.adseat-add')->middleware('permission:adseat');
        Route::post('/add', $namespace . 'AdseatController@saveOrInsert')->middleware('permission:adseat');
        Route::get('/edit/{id}', $namespace . 'AdseatController@edit')->name('admin.adseat-edit')->middleware('permission:adseat');
        Route::post('/edit/{id}', $namespace . 'AdseatController@saveOrInsert')->middleware('permission:adseat');
        Route::get('/ajax', $namespace . 'AdseatController@indexAjax')->name('admin.adseatAjax')->middleware('permission:adseat');
    });
    //郑州概况
    Route::group(['prefix' => 'area'], function () use ($namespace) {
        $namespace .= 'Area\\';
        Route::get('', $namespace . 'AreaController@index')->name('admin.area')->middleware('permission:posts');
        Route::get('/add', $namespace . 'AreaController@add')->name('admin.area-add')->middleware('permission:posts');
        Route::post('/add', $namespace . 'AreaController@saveOrInsert')->middleware('permission:posts');
        Route::get('/edit/{id}', $namespace . 'AreaController@edit')->name('admin.area-edit')->middleware('permission:posts');
        Route::post('/edit/{id}', $namespace . 'AreaController@saveOrInsert')->middleware('permission:adseat');
        Route::get('/ajax', $namespace . 'AreaController@indexAjax')->name('admin.areaAjax')->middleware('permission:posts');
    });
    //栏目（暂时只有新闻动态）
    Route::group(['prefix' => 'categories'], function () use ($namespace) {
        $namespace .= 'Category\\';
        Route::get('', $namespace . 'CategoryController@index')->name('admin.category')->middleware('permission:posts');
        Route::get('/add', $namespace . 'CategoryController@add')->name('admin.category-add')->middleware('permission:posts');
        Route::post('/add', $namespace . 'CategoryController@saveOrInsert')->middleware('permission:posts');
        Route::get('/edit/{id}', $namespace . 'CategoryController@edit')->name('admin.category-edit')->middleware('permission:posts');
        Route::post('/edit/{id}', $namespace . 'CategoryController@saveOrInsert')->middleware('permission:posts');
        Route::get('/ajax', $namespace . 'CategoryController@indexAjax')->name('admin.categoryAjax')->middleware('permission:posts');
    });
    //微信
    Route::group(['prefix' => 'wechat'], function () use ($namespace) {
        $namespace .= "Wechat\\";
        Route::group(['prefix' => 'material'], function () use ($namespace) {
            $namespace .= 'Material\\';
            Route::get('', $namespace . 'MaterialController@index')->name('admin.wechat.material')->middleware('permission:wx');
            Route::get('/add', $namespace . 'MaterialController@add')->name('admin.wechat.material-add')->middleware('permission:wx');
            Route::post('/add', $namespace . 'MaterialController@saveOrInsert')->middleware('permission:wx');
            Route::get('/edit/{id}', $namespace . 'MaterialController@edit')->name('admin.wechat.material-edit')->middleware('permission:wx');
            Route::post('/edit/{id}', $namespace . 'MaterialController@saveOrInsert')->middleware('permission:wx');
            Route::get('/ajax', $namespace . 'MaterialController@indexAjax')->name('admin.wechat.materialAjax')->middleware('permission:wx');
        });
        Route::group(['prefix' => 'send'], function () use ($namespace) {
            $namespace .= 'Send\\';
            Route::get('', $namespace . 'IndexController@index')->name('admin.wechat.send')->middleware('permission:wx');
            Route::get('/add', $namespace . 'IndexController@add')->name('admin.wechat.send-add')->middleware('permission:wx');
            Route::post('/add', $namespace . 'IndexController@store')->middleware('permission:wx');
            Route::post('/edit/{id}', $namespace . 'IndexController@saveOrInsert')->middleware('permission:wx');
            Route::get('/ajax', $namespace . 'IndexController@indexAjax')->name('admin.wechat.sendAjax')->middleware('permission:wx');
            Route::get('/newsList', $namespace . 'IndexController@newsList')->name('admin.wechat.send.newsList')->middleware('permission:wx');
            Route::get('/ajaxNewsList', $namespace . 'IndexController@newsListAjax')->name('admin.wechat.send.newsListAjax')->middleware('permission:wx');
        });
    });
    Route::get('/setWorker', $namespace . 'Member\\MemberController@setWorker')->name('setWorker');
    Route::get('/noWorker', $namespace . 'Member\\MemberController@noWorker')->name('noWorker');
    Route::get('/setDisplay', $namespace . 'Member\\MemberController@setDisplay')->name('setDisplay');
    Route::get('/noDisplay', $namespace . 'Member\\MemberController@noDisplay')->name('noDisplay');
    //设备管理
    Route::group(['prefix' => 'device'], function () use ($namespace) {

        Route::get('/', $namespace . 'DeviceController@index')->name('admin.device')/*->middleware('permission:device')*/
        ;
        Route::get('/{id}/spot', $namespace . 'DeviceController@spot')->name('admin.device.spot')/*->middleware('permission:device')*/
        ;
        //查看详情
        Route::get('/{id}/show', $namespace . 'DeviceController@show')/*->middleware('permission:device')*/
        ;
        Route::get('/bind/{device_id}/{page_id}', $namespace . 'DeviceController@bind')/*->middleware('permission:device')*/
        ;

        //修改备注
        Route::get('/edit/{device_id}', $namespace . 'DeviceController@edit')->name('admin.device.edit')/*->middleware('permission:device')*/
        ;
        Route::get('/', $namespace . 'DeviceController@index')->name('admin.device')/*->middleware('permission:device')*/
        ;
        Route::get('/ajax', $namespace . 'DeviceController@ajaxList')->name('admin.deviceAjax')/*->middleware('permission:device')*/
        ;
        Route::get('/add', $namespace . 'DeviceController@add')->name('admin.device_add')/*->middleware('permission:device')*/
        ;
        Route::post('/store', $namespace . 'DeviceController@store')->name('admin.device_store')/*->middleware('permission:device')*/
        ;
        //  Route::get('/',$namespace.'DeviceController@store')->name('admin.device_sotre')/*->middleware('permission:device')*/;
    });

    Route::group(['prefix' => 'scene'], function () use ($namespace) {
        $namespace .= "Scene\\";
        Route::group(['prefix' => 'introduce'], function () use ($namespace) {
            $namespace .= 'IntroduceController@';
            Route::get('', $namespace . 'index')->name('admin.scene.introduce')->middleware('permission:wap');
            Route::post('', $namespace . 'update')->name('admin.scene.introduce.update')->middleware('permission:wap');
        });
        Route::group(['prefix' => 'spot'], function () use ($namespace) {
            $namespace .= 'SpotController@';
            Route::get('', $namespace . 'index')->name('admin.scene.spot')->middleware('permission:scene');
            Route::get('/add', $namespace . 'add')->name('admin.scene.spot.add')->middleware('permission:scene');
            Route::post('/add', $namespace . 'saveOrInsert')->middleware('permission:scene');
            Route::get('/edit/{id}', $namespace . 'edit')->name('admin.scene.spot.edit')->middleware('permission:scene');
            Route::post('/edit/{id}', $namespace . 'saveOrInsert')->middleware('permission:scene');
            Route::get('/ajax', $namespace . 'indexAjax')->name('admin.scene.spot.Ajax')->middleware('permission:scene');
        });
    });

    Route::get('/memberLog', 'Admin\\CaiwuController@index')->middleware('permission:finance');
    Route::get('/memberLogAjax', 'Admin\\CaiwuController@ajax')->name('admin.caiwu.ajax')->middleware('permission:finance');
    Route::get('/memberLogExport', 'Admin\\CaiwuController@export')->name('caiwu.exportList')->middleware('permission:finance');

    Route::group(['prefix' => 'business'], function () use ($namespace, $prefix) {
        $namespace .= "Business\\";
        $prefix .= '.business';
        Route::group(['prefix' => 'combo'], function () use ($namespace, $prefix) {
            $namespace .= 'ComboController@';
            $prefix .= '.combo';
            $permission = 'combo';
            Route::get('', $namespace . 'index')->name($prefix)->middleware('permission:' . $permission);
            Route::get('/add', $namespace . 'add')->name($prefix . '.add')->middleware('permission:' . $permission);
            //发送门票

            Route::post('/add', $namespace . 'saveOrInsert')->middleware('permission:' . $permission);
            Route::get('/edit/{id}', $namespace . 'edit')->name($prefix . '.edit')->middleware('permission:' . $permission);
            Route::post('/edit/{id}', $namespace . 'saveOrInsert')->middleware('permission:' . $permission);

            Route::get('/ajax', $namespace . 'indexAjax')->name($prefix . '.Ajax')->middleware('permission:' . $permission);
            Route::get('/read/{id}', $namespace . 'read')->name($prefix . '.read')->middleware('permission:' . $permission);
        });
        Route::group(['prefix' => 'comboActivities'], function () use ($namespace, $prefix) {
            $namespace .= 'ComboActivitiesController@';
            $prefix .= '.comboActivities';
            $permission = 'combo';
            Route::get('', $namespace . 'index')->name($prefix)->middleware('permission:' . $permission);
            Route::get('/add', $namespace . 'add')->name($prefix . '.add')->middleware('permission:' . $permission);
            Route::post('/add', $namespace . 'saveOrInsert')->middleware('permission:' . $permission);
            Route::get('/edit/{id}', $namespace . 'edit')->name($prefix . '.edit')->middleware('permission:' . $permission);
            Route::post('/edit/{id}', $namespace . 'saveOrInsert')->middleware('permission:' . $permission);
            Route::get('/ajax', $namespace . 'indexAjax')->name($prefix . '.Ajax')->middleware('permission:' . $permission);
            Route::get('/comboList', $namespace . 'comboList')->name($prefix . '.comboList')->middleware('permission:' . $permission);
            Route::get('/read/{id}', $namespace . 'read')->name($prefix . '.read')->middleware('permission:' . $permission);


        });
        Route::group(['prefix' => 'comboOrder'], function () use ($namespace, $prefix) {
            $namespace .= 'ComboOrderController@';
            $prefix .= '.comboOrder';
            $permission = 'combo';
            Route::get('', $namespace . 'index')->name($prefix)->middleware('permission:' . $permission);
            Route::get('/ajax', $namespace . 'indexAjax')->name($prefix . '.Ajax')->middleware('permission:' . $permission);
            Route::get('/read/{id}', $namespace . 'read')->name($prefix . '.read')->middleware('permission:' . $permission);
            Route::get('/report', $namespace . 'exportReport')->name($prefix . '.report')->middleware('permission:' . $permission);
            Route::get('/send', $namespace . 'send')->name('combo_order.send')->middleware('permission:' . $permission);
        });
    });
    Route::group(['prefix' => 'member'], function () use ($namespace, $prefix) {
        $namespace .= "Member\\";
        $prefix .= '.member';
        Route::group(['prefix' => 'member'], function () use ($namespace, $prefix) {
            $namespace .= 'MemberController@';
            $prefix .= '.member';
            $permission = 'member';
            Route::get('/jingdian',  $namespace.'jingdian')->name('jingdian');
            Route::post('/jingdianUpdate',  $namespace.'jingdianUpdate')->name('admin.member.jingdian');
            Route::get('', $namespace . 'index')->name($prefix)->middleware('permission:' . $permission);
            Route::get('/ajax', $namespace . 'indexAjax')->name($prefix . '.Ajax')->middleware('permission:' . $permission);
            Route::get('/distribute/{id}', $namespace . 'distribute')->name($prefix . '.distribute')->middleware('permission:' . $permission);
            Route::get('/exportList', $namespace . 'exportList')->name('member.exportList')->middleware('permission:' . $permission);

            Route::get('/scene/{id}', $namespace . 'scene')->name($prefix . '.scene')->middleware('permission:' . $permission);
        });
        Route::group(['prefix' => 'recharge'], function () use ($namespace, $prefix) {
            $namespace .= 'RechargeController@';
            $prefix .= '.recharge';
            $permission = 'member';
            Route::get('', $namespace . 'index')->name($prefix)->middleware('permission:' . $permission);
            Route::get('/ajax', $namespace . 'indexAjax')->name($prefix . '.Ajax')->middleware('permission:' . $permission);
            Route::get('/read/{id}', $namespace . 'read')->name($prefix . '.read')->middleware('permission:' . $permission);
        });
    });

    Route::group(['prefix' => 'finance'], function () use ($namespace, $prefix) {
        $namespace .= "Finance\\";
        $prefix .= '.finance';

        Route::group(['prefix' => 'account'], function () use ($namespace, $prefix) {
            $namespace .= 'AccountController@';
            $prefix .= '.account';
            $permission = 'finance';
            Route::get('/order', $namespace . 'order')->name('orderTotal');
            Route::get('/orderAjax', $namespace . 'OrderAjax')->name(  'orderTotal.Ajax');
            Route::get('', $namespace . 'index')->name($prefix)->middleware('permission:' . $permission);
            Route::get('/ajax', $namespace . 'indexAjax')->name($prefix . '.Ajax')->middleware('permission:' . $permission);

            Route::get('/read/{id}', $namespace . 'read')->name($prefix . '.read')->middleware('permission:' . $permission);
        });
        Route::group(['prefix' => 'withdraw'], function () use ($namespace, $prefix) {
            $namespace .= 'WithdrawController@';
            $prefix .= '.withdraw';
            $permission = 'finance';
            Route::get('', $namespace . 'index')->name($prefix)->middleware('permission:' . $permission);
            Route::post('', $namespace . 'index')->middleware('permission:' . $permission);
            Route::get('/ajax', $namespace . 'indexAjax')->name($prefix . '.Ajax')->middleware('permission:' . $permission);
            Route::get('/read/{id}', $namespace . 'read')->name($prefix . '.read')->middleware('permission:' . $permission);
            Route::get('/add', $namespace . 'add')->name($prefix . '.add')->middleware('permission:' . $permission);
            Route::post('/add', $namespace . 'saveOrInsert')->middleware('permission:' . $permission);
            Route::get('/memberList', $namespace . 'memberList')->name($prefix . '.memberList')->middleware('permission:' . $permission);

        });
    });
    Route::group(['prefix' => 'report'], function () use ($namespace, $prefix) {
        $namespace .= "Report\\";
        $namespace .= 'ReportController@';
        $permission = 'report';
        $prefix .= '.report';
        Route::get('/sale', $namespace . 'sale')->name($prefix . '.sale')->middleware('permission:' . $permission);
        Route::get('/distribute', $namespace . 'distribute')->name($prefix . '.distribute')->middleware('permission:' . $permission);
        Route::get('/spot', $namespace . 'spot')->name($prefix . '.spot')->middleware('permission:' . $permission);
    });
});
//admin 登陆
Route::get('adminlogin', 'Admin\LoginController@showLoginForm');
//登录表单提交
Route::post('admin/loginPost', 'Admin\LoginController@Login')->name('admin.login');

Route::get('/error', 'Admin\IndexController@error')->name('admin.error');

Route::any('/wx', 'Wx\IndexController@index')->name('wx');
